package com.gin.ehdownloader.config;

import com.gin.ehdownloader.datafile.ConfigDataFile;
import com.gin.ehdownloader.datafile.TaskDataFile;
import com.gin.ehdownloader.entity.EhConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;

/**
 * 数据文件配置
 * @author : ginstone
 * @version : v1.0.0
 * @since : 2023/3/31 17:18
 */
@Configuration
public class DataFileConfig {
    @Bean
    public TaskDataFile taskDataFile() throws IOException {
        return new TaskDataFile(new ArrayList<>(), new File("./tasks.json"));
    }

    @Bean
    public ConfigDataFile configDataFile() throws IOException {
        return new ConfigDataFile(new EhConfig("E:\\download\\aria2\\eh"), new File("./config.json"));
    }

}   
